﻿using Common.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.AspNetCore
{
    public interface ICommonModelRepository
    {
        Task<T> GetModelAsync<T>(string id, string[] includes = null)
               where T : ModelBase, new();

        Task<T> GetModelAsync<T>(ApiParam apiParam, string[] includes = null)
           where T : ModelBase, new();

        Task<List<T>> GetModelsAsync<T>(List<string> ids, string[] includes = null)
           where T : ModelBase, new();

        Task<List<T>> GetModelsAsync<T>(ApiParam apiParam, string[] includes = null)
           where T : ModelBase, new();

        Task<List<T>> GetOrderModelsAsync<T>(ApiParam apiParam, string[] includes = null)
           where T : ModelBase, new();

        Task<ApiPagedResult<T>> GetOrderPageModelsAsync<T>(ApiOrderPageParam apiOrderPageParam, string[] includes = null)
         where T : ModelBase, new();

        object GetModelByIdByReqest(ModelIdRequest model);

        object GetModelByRequest(ModelRequest model);

        object GetOrderModelByRequest(ModelRequest model);

        object GetOrderPageModelByRequest(ModelOrderPageRequest model);

        Task SaveModelsAsync(ModelSaveRequest request);

        Task DeleteModelsAsync(ModelDeleteRequest request);

        List<string> GetIdsByEntity(IDParam param);
    }
}
